package com.tyut.service.Impl;

import com.tyut.mapper.PropertyMapper;
import com.tyut.pojo.Property;
import com.tyut.service.PropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PropertyServiceImpl implements PropertyService {

    @Autowired
    private PropertyMapper propertyMapper;

    @Override
    public List<Property> findPropertyAll() {
        List<Property> allProperty = propertyMapper.findPropertyAll();
        return allProperty;
    }

    @Override
    public List<Property> findPropertyByBuildingFloorDormBed(String building, String floor, String dorm, String bed) {
        List<Property> propertyByBuildingFloorDormBed = propertyMapper.findPropertyByBuildingFloorDormBed(building, floor, dorm, bed);
        return propertyByBuildingFloorDormBed;
    }

    @Override
    public int updateProperty(String id) {
        int i = propertyMapper.updateStatus(id);
        return i;
    }

    @Override
    public int updateTime(String format, String id) {
        int i = propertyMapper.updateTime(format, id);
        return i;
    }

    @Override
    public int insertProperty(Property property) {
        int i = propertyMapper.insert(property);
        return i;
    }
}
